home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************************/
- /* HEADER FILE FOR DATABOSS MODULE: DB_MNU */
- /****************************************************************************/
-
- /******************************* CONSTANTS ********************************/
-
- extern extstr MnuExt; /* = ".MEN" */
-
- #define Indicator1 16
- #define Indicator2 25
- #define QEName "MENU"
- #define MnuDetSz 67
- #define ItmDetSz 6
- #define MaxMnus 255
- #define Up 0
- #define Down 1
- #define Vert 0
-
- /********************************* TYPES **********************************/
-
- typedef enum {InMem,OnDisk,UnForced} helpmode;
- typedef struct hilitebar {
- bool disp;
- int xp;
- int yp;
- string savstr;
- string savatr;
- winptr winp;
- } hilitebar;
- typedef struct mnutyp {
- byte mno; /* Reference for user recognition */
- int xm; /* Offset position w.r.t screen */
- int ym;
- byte widm; /* Dimensions for the viewable Window Region */
- byte hgtm;
- byte mnucolr; /* Window Base Color */
- byte mbcolr; /* Border Color/Attribute */
- byte mshad; /* 0-NO Shadow otherwise shadow attribute */
- border mbchrs; /* The four sides and corners of the border */
- byte mtitlej; /* Title Justification */
- titlestr mtitle; /* Title String */
- byte apc; /* Active Prompt Color */
- byte ipc; /* Inactive Prompt Color */
- byte hc; /* Highlight Character Color */
- byte sl; /* Security Level */
- byte pmnu; /* Prev menu in tree via MActTbl */
- byte mtyp;
- byte hbc;
- winptr winp;
- struct itmtyp *litm; /* the last item accessed */
- struct itmtyp *fitm; /* first item in window (nil if none) */
- struct itmtyp *hitm; /* Hilighted Item */
- } mnutyp, *mnuptr;
- typedef struct alttyp {
- uchar altcomb[4]; /* Alt Keys to activate the Item */
- struct itmtyp *nxtalt; /* Pointer for chain of all valid Alt Key sets */
- struct mnutyp *parmnu; /* To which Menu does this item belong */
- } alttyp;
- typedef struct itmtyp {
- byte ix; /* the X (column position for hilite bar */
- byte iy; /* the Y (line position for hilite bar */
- byte sec; /* Item security level */
- byte prpos; /* Prompt character to hilight */
- uchar seltyp; /* M-Menu,E-execute,NONE-no action, etc. */
- byte editsec; /* Editable security */
- strptr selpath; /* Path to change to when executing a program */
- strptr selact; /* activity win#, item# or file names */
- uchar selwait; /* [Y/N] to wait after Exec'ing a program */
- strptr selcmd; /* possible command line parameters for SelAct */
- strptr prompt; /* Item Prompt */
- alttyp altern; /* Alt Keys to activate the Item */
- winptr helpwin; /* Pointer to the Help Window */
- struct itmtyp *nitm; /* the next item (nil if none */
- struct itmtyp *pitm; /* the prev item (nil if none */
- } itmtyp, *itmptr;
- typedef mnuptr macttbl[MaxMnus];
- typedef struct mnufrec {
- pathstr mnufnam;
- winptr basewin1;
- winptr basewin2;
- hilitebar hb;
- macttbl mat;
- struct mnutyp *curmnu;
- struct itmtyp *curitm;
- int level;
- int dx;
- int dy;
- struct itmtyp *altcomb1;
- set mnualtset;
- byte scrmode;
- helpmode wherehelp;
- int mactfil;
- bool mactopen;
- word savattr;
- } mnufrec;
- typedef void (*actionproc)(mnufrec *m, itmptr itm);
-
- /************************* INITIALIZED VARIABLES **************************/
-
- extern bool FINE; /* = False */
-
- /******************************* VARIABLES ********************************/
-
- extern bool stophelp;
- extern helpmode forceh;
- extern byte backjump;
- extern byte esecurity;
-
- /******************************* PROTOTYPES *******************************/
-
- void itemhelp(mnufrec *m);
- void disposemnus(mnufrec *m);
- void processalt(uchar ach, mnufrec *m, actionproc do_proc);
- void initmnu(mnufrec *m, byte s, byte n, helpmode whereh);
- void dspmnu(mnufrec *m, mnuptr mnu);
- void zapmnu(mnufrec *m, mnuptr mnu);
- bool selitm(uchar letter, mnufrec *m);
- itmptr traceup(mnufrec *m, mnuptr cm, int fm);
- bool inmchain(mnufrec *m, byte pm);
- void firstitm(mnufrec *m);
- void lastitm(mnufrec *m);
- void goud(mnufrec *m, int dirn);
- void gorl(mnufrec *m, int dirn);
- void jumptomnu(mnufrec *m, byte mno);
- void hbar(mnufrec *m);
-
- void db_mnu_init(void);
-
- /****************************** END OF DB_MNU.H *****************************/
-